<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="app" uri="/application" %>
<%@ taglib  prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<link href="../css/dtree.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../scripts/dtreeAuth.js"></script>
<style type="text/css">
   .art_ul {}
   .art_ul li{padding:2px;display:block;border:1px solid red;overflow: hidden;border:1px solid #666;}
   .art_ul li img{width:120px;height:88px;}
   .art_ul div{float:left;padding:2px;}
   .content_main table td {text-align: left;}
</style>
<script type="text/javascript">
				
</script>
</head>
<body>
<div id="all_main">
  <div class="head_main">
    <div class="main_nav">活动管理->添加|编辑活动信息</div>
    <div class="main_soso">
    	
    </div>
    <div class="main_title">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <th width="100%" style="border-left:none;text-align: left;font-weight: normal;">活动基本信息 </th>
        </tr>
      </table>
    </div>
  </div>
  <div class="content_main">
    <form action="/operator/su_campaign.shtml"   name="form01" method="post" enctype="multipart/form-data">
    <input name="id" value="${campaign.id}"  type="hidden"/>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="background_hegh01">
     
      <tr>
        <td width="15%" style="border-left:none" align="right">点击类型：</td>
         <td width="">
         <select name="campaign.clickType">
	            <option value="webview" <c:if test="${campaign.clickType=='webview'}">selected="selected"</c:if>>webview</option>
	            <option value="activity" <c:if test="${campaign.clickType =='activity'}">selected="selected"</c:if>>activity</option>
	       </select>
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">目标：</td>
         <td width="">
         	<select name="campaign.target">
	            <option value="activity" <c:if test="${campaign.target=='activity'}">selected="selected"</c:if>>activity</option>
	            <option value="target" <c:if test="${campaign.target=='target'}">selected="selected"</c:if>>target</option>
	        </select>
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">位置：</td>
        <td width="">
       <select name="campaign.playType" onchange="channe();" id="channe_mode" >
			<c:forEach items="${cpl}" var="entry">
				<option value="${entry.playType}" <c:if test="${campaign.playType eq entry.playType}"> selected="selected" </c:if>>${entry.playType}-${entry.positionName}</option>
			</c:forEach>
		</select>
		 <span id="channe_mode_1" style="display: none;">
	     推荐价格:<input name="campaign.tuiPrice" type="text" onkeypress="util.justNum(46);" value="${campaign.tuiPrice}" style="width:60px;" class="inputwidth01" id="campaign.tuiPrice" maxlength="30" />
	     &nbsp;推荐商品id:<input name="campaign.productId" type="text" value="${campaign.productId}" />
	       
	     </span>
        </td>
        <!-- 
         
        <select name="campaign.playType" onchange="channe();" id="channe_mode" >
	            <option value="banner" <c:if test="${campaign.playType=='banner'}">selected="selected"</c:if>>banner</option>
	            <option value="tuijian" <c:if test="${campaign.playType=='tuijian'}">selected="selected"</c:if>>tuijian</option>
	     </select>
	     <span id="channe_mode_1" style="display: none;">
	     推荐价格:<input name="campaign.tuiPrice" type="text" onkeypress="util.justNum(46);" value="${campaign.tuiPrice}" style="width:60px;" class="inputwidth01" id="campaign.tuiPrice" maxlength="30" />
	     &nbsp;推荐商品id:<input name="campaign.productId" type="text" value="${campaign.productId}" />
	       
	     </span>
        </td>
        -->
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">排序：</td>
        <td width=""><input name="campaign.seq" type="text" value="${campaign.seq}" style="width:240px;" class="inputwidth01" id="campaign.seq" maxlength="30" /> <span style="color:red;">*</span>
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">点击url：</td>
        <td width=""><input name="campaign.clickUrl" type="text" value="${campaign.clickUrl}" style="width:240px;" class="inputwidth01" id="campaign.clickUrl"  /> <span style="color:red;">*</span>
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">文字描述：</td>
        <td width=""><input name="campaign.text" type="text" value="${campaign.text}" style="width:240px;" class="inputwidth01" id="campaign.text" maxlength="64" /> <span style="color:red;">*</span>
        </td>
      </tr>
      <tr>
        <td width="15%" style="border-left:none" align="right">跳转参数(param)：</td>
        <td width=""><input name="campaign.param" type="text" value="<c:out value="${campaign.param}"></c:out>" style="width:320px;" class="inputwidth01" id="campaign.param" maxlength="512" /> 
        如:{pkg:"com.petany.service.ui.activity.PetSayActivity"}
        </td>
      </tr> 
      <tr>
        <td width="15%" style="border-left:none" align="right">图片：</td>
        <td width=""><input name="img3File" value="" type="file" size="20"  class="inputwidth01"  />
        <c:if test="${!empty campaign.imgUrl}">
          <br/>
          <img src="${campaign.imgUrl }" style="width:200px;"/>
          <br/>${campaign.imgUrl}
        </c:if>
        </td>
      </tr>
    </table>
    </form>
  </div>
  <div class="lapel" style="background:#FFFFFF;"><span><input name="" type="button" class="input01" value="保存" onclick="validate.submit();"/>&nbsp;
  <input name="" type="button" class="input01" value="返回列表" onclick="javascript:document.location='/operator/search_campaign.shtml'"/></span></div>
  
</div>
 <iframe  style="display:none" src="about:blank" name="ifrComposeAttachUpload"></iframe>
</body>
</html>
<script type="text/javascript" src="/scripts/util.js"></script>
<script type="text/javascript" src="/scripts/form_validate.js"></script>
<script type="text/javascript" src="/scripts/calendar.js"></script>
<script type="text/javascript" src="/scripts/page.js"></script>
<script type="text/javascript" src="/scripts/xhr.js"></script>
<script type="text/javascript">

 //new WBFS({url:'/resource/to_resource.shtml',title:'选择文件',btn:"product.imgPath"});
 //new WBFS({url:'/resource/to_resource.shtml',title:'选择文件',btn:"product.soundDesc"});
 
validate.addvalidte(document.form01,{
        rules:{
           "campaign.clickType":{checkNull:true},
           "campaign.target":{checkNull:true},
           "campaign.playType":{checkNull:true},
           "campaign.seq":{checkNull:true},
           "campaign.clickUrl":{checkNull:true},
           "campaign.text":{checkNull:true},
           "campaign.img3File":{checkNull:true,suffix:/.png|.bmp|.gif/i},
           },
	    message:{
	    }
	    });
 
 

	
function channe(){
      var a =document.getElementById("channe_mode").value; 
      if(a=='banner'){
    	  document.getElementById("channe_mode_1").style.display="none";
          }else{
        document.getElementById("channe_mode_1").style.display="inline";
              }
		}	
channe();
</script>